<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->nullable()->comment('姓名');
            $table->string('phone')->index()->unique()->comment('手机');
            $table->string('password')->comment('密码');
            $table->boolean('gender')->default(0)->comment('性别 0未知  1男  2女');
            $table->string('avatar')->nullable()->comment('头像');
            $table->string('role_name')->nullable()->comment('角色名');
            $table->unsignedTinyInteger('status')->default(1)->comment(' 状态    0禁用   1启用');
            $table->unsignedTinyInteger('is_owner')->default(0)->comment(' 是否是店长    0不是   1是店长');
            $table->string('remarks')->nullable()->comment('备注');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin');
    }
}
